﻿using System;

using System.Windows.Forms;

namespace HRM
{
    public partial class frmDepart : Form
    {
        #region Parameter
        int _BranchID;
        public int BranchID
        {
            get { return _BranchID; }
            set { _BranchID = value; }
        }

        int _DepartmentID;
        public int DepartmentID
        {
            get { return _DepartmentID; }
            set { _DepartmentID = value; }
        }
        #endregion

        public frmDepart()
        {
            InitializeComponent();
            UISetting.LoadBranch(ref cboBranch);
        }
        void LoadLanguage()
        {
            if (this.Tag != null)
                this.Text = UpdateUI.GetString(this.Tag.ToString());
            UpdateUI.Load_Panel(ref panel2);
        }
        private void btnView_Click(object sender, EventArgs e)
        {
            _BranchID = Convert.ToInt32(cboBranch.SelectedValue);
            _DepartmentID = Convert.ToInt32(cboDepartment.SelectedValue);
            this.DialogResult = DialogResult.OK;
        }
        private void cboBranch_SelectedIndexChanged(object sender, EventArgs e)
        {
            UISetting.LoadDepartment(ref cboDepartment, Convert.ToInt32(cboBranch.SelectedValue));
        }
        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}
